/////////////////////////////////////////////////////////////////////////////
//
// CodeLib.h
//
//
/////////////////////////////////////////////////////////////////////////////
#pragma once

#include "xepdt.h"
#include <string>

class XEPDT_API CCodeLib
{
// Construction
public:
	CCodeLib();
	virtual ~CCodeLib();

// Implementation
public:


	static void UnicodeToGB2312( char* pchOut,  unsigned short uData );

	static void UTF8ToGB2312( std::string& strOut, const char* pchIn, int nLen );

	
	static void GB2312ToUTF8( std::string& strOut, const char* pchIn, int nLen );
	
	// UTF-8 to Unicode
	static std::wstring UTF8ToUnicode( const char* pchIn );
	// Unicode to UTF-8
	static std::string UnicodeToUTF8( const WCHAR* pwchIn );

	static void GB2312ToUnicode( WCHAR* pwchOut, const char* pchIn );

	// GB2312 to Unicode
	static std::wstring GB2312ToUnicode( const char* pchIn );
	// Unicode to GB2312
	static std::string UnicodeToGB2312( const WCHAR* pwchIn );

	// GB2312 to UTF-8
	static std::string GB2312ToUTF8( const char* pchIn );
	// UTF-8e to GB2312
	static std::string UTF8ToGB2312( const char* pchIn );
};